<h1>Listing comments</h1>

<table>
  <tr>
    <th>Body</th>
    <th>Published</th>
    <th>Post</th>
  </tr>

<% @comments.each do |comment| %>
  <tr>
    <td><%=h comment.body %></td>
    <td><%=h comment.published %></td>
    <td><%= link_to 'Show', [comment.post, comment] %></td>
    <td><%= link_to 'Edit', edit_post_comment_path(comment.post, comment) %></td>
    <td><%= link_to 'Destroy', [comment.post, comment], :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New comment', new_post_comment_path(@post) %>